package org.dfzt.modules.online.cgform.enhance.a;

import com.alibaba.fastjson.JSONObject;
import java.util.Map;
import org.dfzt.modules.online.cgform.enhance.CgformEnhanceJavaInter;
import org.dfzt.modules.online.config.exception.BusinessException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component("cgformEnhanceImportDemo")
public class c
  implements CgformEnhanceJavaInter
{
  private static final Logger a = LoggerFactory.getLogger(c.class);



  
  public int execute(String tableName, JSONObject json) throws BusinessException {
    a.info("--------我是自定义java增强测试bean 导入示例-----------");
    a.info("--------当前tableName=>" + tableName);
    a.info("--------当前JSON数据=>" + json.toJSONString());
    
    if (json.get("ee") == null) {
      return 1;
    }
    
    if (json.getString("ee").equals("hello")) {
      json.put("id", "testid123");
      json.put("ee", "java 增强导入测试修改");
      return 2;
    } 
    
    if (json.getString("ee").equals("ok"))
    {
      return 0;
    }
    
    return 1;
  }



  
  public int execute(String tableName, Map<String, Object> map) throws BusinessException { return 1; }
}
